package com.dxq.test.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dxq.test.R;
import com.dxq.test.db.Breed;
import com.dxq.test.db.Vaccine;

import java.util.List;

/**
 * Author: zsh
 * Date: 2023/11/18
 * Describe: 配种列表adapter
 */
public class BreedAdapter extends BaseQuickAdapter<Breed, BaseViewHolder> {

    public BreedAdapter(int layoutResId) {
        this(layoutResId, null);
    }

    public BreedAdapter(int layoutResId, @Nullable List<Breed> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, Breed item) {
        //holder.setText(R.id.tvSize, String.valueOf(1 + holder.getLayoutPosition()));
        holder.setText(R.id.tvCode, item.getCode());
        holder.setText(R.id.tvTime, item.getTime());
        holder.setText(R.id.tvBirthTime, item.getBirth_time());
        if (item.getLabel_w() != null)
            holder.setText(R.id.tvWLabel, item.getLabel_w().getName());
        if (item.getLabel_m() != null)
            holder.setText(R.id.tvMLabel, item.getLabel_m().getName());
    }
}
